package com.cet.reactor;

import reactor.core.publisher.Flux;

import java.sql.SQLOutput;

public class SubscribeTestDemo {

    public static void main(String[] args) {

        Flux<String> flux = Flux.range(1, 10)
                .map(item -> {
                    if(item == 8)
                        return "hhh-" + item/0;
                    return "hhh-" + item;
                })
//                .onErrorComplete()
                ;

        flux.subscribe(v -> System.out.println("v=" + v),
                throwable -> System.out.println("error=" + throwable),
                () -> System.out.println("done, flux success finished")
        );
    }
}
